package com.zzf.eduservice.controller;

import com.zzf.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(description = "登录")
@RequestMapping("/eduservice/user")
//@CrossOrigin//解决跨域访问问题
public class EduLoginController {
    //login
    @ApiOperation("登录")
    @PostMapping("login")
    public R login(){
        return R.ok().data("token","admin");
    }

    //info
    @ApiOperation("获取用户信息")
    @GetMapping("info")
    public R info(){
        return R.ok().data("roles","[admin]").data("name","admin").data("avatar","https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201810%2F24%2F20181024133921_wlvbo.thumb.700_0.jpeg&refer=http%3A%2F%2Fb-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1620054374&t=125a6deb865ffef9cfb0bb51ad7d762f");
    }
}
